﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyMenu_Edit.aspx.cs" Inherits="SYS_POPEDOM_MyMenu_Edit" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>

    <script type="text/javascript" src="../JavaScript/Common.js"></script>

    <script type="text/javascript">

        function SaveMyMenu() {
            Ext.net.DirectMethods.SaveMyMenu({ success: Closepopwin });
            parent.Store1.reload();
        }

        function Cancel() {
            Closepopwin();
        }
        function AddSeledRows() {
            var record = GridPanel1.getSelectionModel().getSelections();
            var i = 0;
            for (; i < record.length; i++) {
                Ext.net.DirectMethods.AddSeledRowsToTB(record[i].get("MENU_NO"), record[i].get("MENU_NAME"));
            }
        }
        function AddSeledRows1() {
            var record = GridPanel2.getSelectionModel().getSelections();
            var i = 0;
            for (; i < record.length; i++) {
                Ext.net.DirectMethods.DelSeledRowsFromTB(record[i].get("MENU_NO"), record[i].get("MENU_NAME"));
            }
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <ext:ResourceManager ID="ResourceManager1" runat="server" AjaxViewStateMode="Enabled" />
        <ext:Store ID="Store1" runat="server" AutoLoad="true">
            <Reader>
                <ext:JsonReader IDProperty="MENU_NO">
                    <Fields>
                        <ext:RecordField Name="MENU_NO">
                        </ext:RecordField>
                        <ext:RecordField Name="MENU_NAME">
                        </ext:RecordField>
                    </Fields>
                </ext:JsonReader>
            </Reader>
            <SortInfo Direction="ASC"></SortInfo>
        </ext:Store>
        <ext:Store ID="Store2" runat="server" AutoLoad="true">
            <Reader>
                <ext:JsonReader IDProperty="MENU_NO">
                    <Fields>
                        <ext:RecordField Name="MENU_NO">
                        </ext:RecordField>
                        <ext:RecordField Name="MENU_NAME">
                        </ext:RecordField>
                    </Fields>
                </ext:JsonReader>
            </Reader>
            <SortInfo Direction="ASC"></SortInfo>
        </ext:Store>
        <ext:Viewport ID="ViewPort1" runat="server">
            <Content>
                <ext:FitLayout ID="FitLayout1" runat="server">
                    <Content>
                        <ext:Panel ID="Panel1" runat="server" ButtonAlign="Center">
                            <Content>
                                <ext:ColumnLayout ID="ColumnLayout1" runat="server" FitHeight="true">
                                    <Columns>
                                        <ext:LayoutColumn ColumnWidth="0.5">
                                            <ext:Panel ID="Panel2" runat="server" Title="选择功能" Width="125" Height="380" ContentBorder="false">
                                                <Content>
                                                    <ext:Panel ID="Panel10" runat="server" ContentBorder="false" Height="380" Layout="FitLayout"
                                                        Border="true">
                                                        <Content>
                                                            <ext:GridPanel ID="GridPanel1" runat="server" Layout="FitLayout" StoreID="Store1"
                                                                ContentStyle="border-width:1 0 0 0px;" AutoScroll="true">
                                                                <ColumnModel>
                                                                    <Columns>
                                                                        <ext:RowNumbererColumn Header="序号" Width="35">
                                                                        </ext:RowNumbererColumn>
                                                                        <ext:Column Header="" DataIndex="MENU_NO" Width="150" Hidden="true">
                                                                        </ext:Column>
                                                                        <ext:Column Header="功能名称" DataIndex="MENU_NAME" Width="150">
                                                                        </ext:Column>
                                                                    </Columns>
                                                                </ColumnModel>
                                                                <SelectionModel>
                                                                
                                                                    <ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" ColumnPosition="1"
                                                                        AllowDeselect="true">
                                                                    </ext:CheckboxSelectionModel>
                                                                </SelectionModel>
                                                            </ext:GridPanel>
                                                        </Content>
                                                    </ext:Panel>
                                                </Content>
                                            </ext:Panel>
                                        </ext:LayoutColumn>
                                        <ext:LayoutColumn>
                                            <ext:Panel ID="Panel3" runat="server" Width="50" Height="200" ContentStyle="border-width:0 1 0 1px;">
                                                <Content>
                                                    <ext:RowLayout ID="RowLayout1" runat="server" Split="true">
                                                        <Rows>
                                                            <ext:LayoutRow RowHeight="0.5">
                                                                <ext:Panel ID="Panel5" runat="server" ContentBorder="false">
                                                                </ext:Panel>
                                                            </ext:LayoutRow>
                                                            <ext:LayoutRow>
                                                                <ext:Panel ID="Panel6" runat="server" Height="100" ContentBorder="false">
                                                                    <Content>
                                                                        <ext:Button ID="Button1" runat="server" Text="---->" Width="50">
                                                                            <Listeners>
                                                                                <Click Fn="AddSeledRows" />
                                                                            </Listeners>
                                                                        </ext:Button>
                                                                    </Content>
                                                                </ext:Panel>
                                                            </ext:LayoutRow>
                                                            <ext:LayoutRow>
                                                                <ext:Panel ID="Panel8" runat="server" Height="100" ContentBorder="false">
                                                                    <Content>
                                                                       
                                                                        
                                                                        <ext:Button ID="Button4" runat="server" Text="删除" Width="50">
                                                                     
                                                                                <Listeners>
                                                                                <Click Fn="AddSeledRows1" />
                                                                            </Listeners>
                                                                        </ext:Button>
                                                                    </Content>
                                                                </ext:Panel>
                                                            </ext:LayoutRow>
                                                            <ext:LayoutRow RowHeight="0.5">
                                                                <ext:Panel ID="Panel7" runat="server" ContentBorder="false">
                                                                </ext:Panel>
                                                            </ext:LayoutRow>
                                                        </Rows>
                                                    </ext:RowLayout>
                                                </Content>
                                            </ext:Panel>
                                        </ext:LayoutColumn>
                                        <ext:LayoutColumn ColumnWidth="0.5">
                                            <ext:Panel ID="Panel4" runat="server" Height="300" Layout="FitLayout" Title="" ContentBorder="false">
                                                <Content>
                                                    <ext:GridPanel ID="GridPanel2" runat="server" Height="300" Layout="FitLayout" StoreID="Store2"
                                                        ContentBorder="false">
                                                        <ColumnModel>
                                                            <Columns>
                                                                <ext:RowNumbererColumn Header="序号" Width="35">
                                                                </ext:RowNumbererColumn>
                                                                <ext:Column Header="" DataIndex="MENU_NO" Width="150" Hidden="true">
                                                                </ext:Column>
                                                                <ext:Column Header="功能名称" DataIndex="MENU_NAME" Width="150">
                                                                </ext:Column>
                                                            </Columns>
                                                        </ColumnModel>
                                                        <SelectionModel>
                                                            <ext:CheckboxSelectionModel ID="CheckboxSelectionModel2" runat="server" ColumnPosition="1"
                                                                AllowDeselect="true">
                                                            </ext:CheckboxSelectionModel>
                                                        </SelectionModel>
                                                    </ext:GridPanel>
                                                </Content>
                                            </ext:Panel>
                                        </ext:LayoutColumn>
                                    </Columns>
                                </ext:ColumnLayout>
                            </Content>
                            <Buttons>
                                <ext:Button ID="extbtn_OK" runat="server" Text="确认" Icon="Accept">
                                    <Listeners>
                                        <Click Fn="SaveMyMenu" />
                                    </Listeners>
                                </ext:Button>
                                <ext:Button ID="extbtn_Cancel" runat="server" Text="取消" Icon="Cancel">
                                    <Listeners>
                                        <Click Fn="Cancel" />
                                    </Listeners>
                                </ext:Button>
                            </Buttons>
                        </ext:Panel>
                    </Content>
                </ext:FitLayout>
            </Content>
        </ext:Viewport>
    </div>
    </form>
</body>
</html>
